using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class LoopLoop : MonoBehaviour
{
    // Start is called before the first frame update

    RectTransform rect;
    Vector3 startPosition;

    void Start()
    {
        rect = GetComponent<RectTransform>();
        startPosition = rect.position;
    }

    // Update is called once per frame
    void Update()
    {
        float tim = Time.time;
        while (tim > 5.0f) tim -= 5.0f;
        while (tim < 0.0f) tim += 5.0f;
        tim /= 5.0f;
        rect.position = startPosition + 440.0f * (tim * Vector3.left);
    }
}
